<#import "/spring.ftl" as spring />
<#import "/inspector-time-macros.ftl" as imacro />
<#setting number_format="0.##"/>

<html>
<head>
	<title>inspection</title>
</head>
<body>

<div id="content">

	<#if emailTemplateForm.emailTemplate.name == 'realtor_thank_you'>
		<h1>REALTOR THANK YOU EMAIL TEMPLATE</h1>
	<#else>
		<h1>HOME BUYER CONFIRMATION EMAIL TEMPLATE</h1>
	</#if>
	
	<@imacro.listErrors "emailTemplateForm" />

	<#if emailTemplateForm.previewBodyHtml??>	
		<div class="blueBox">
		${emailTemplateForm.previewBodyHtml!}
		</div>
		<hr/>
	</#if>
	
	<form action="editEmailTemplate.html" method="post" enctype="multipart/form-data">
	
	<@spring.formHiddenInput "emailTemplateForm.emailTemplate.name" />
	<table>
	<TR>
		<td colspan="2" valign="top">Subject</td>
	</TR>
	<tr>
		<td colspan="2" ><@spring.formInput "emailTemplateForm.emailTemplate.subject", 'size="90", maxlength="255"'/></td>
	</tr>
	<TR>
		<td valign="top"></td>
	</TR>
	<TR>
		<td valign="top">Body</td>
		<td>Valid Expressions</td>
	</TR>
	<tr>
		<td>
			<TABLE>
			<TR>
				<td>
					<@spring.formTextarea "emailTemplateForm.emailTemplate.body", 'cols="45", rows="20"'/>
				</td>
			</TR>
			</TABLE>
		</td>	
		<td>
<textarea readonly="true" cols="20" rows="20">
$&#123buyer.name&#125
$&#123buyer.name.first&#125
$&#123buyer.name.last&#125

$&#123time?datetime&#125
$&#123time?date&#125
$&#123time?time?string.short&#125

$&#123address.street1&#125
$&#123address.street2!&#125
$&#123address.city&#125
$&#123address.state&#125
$&#123address.zipCode&#125

$&#123inspector.name&#125
$&#123inspector.name.first&#125
$&#123inspector.name.last&#125
$&#123company.name&#125
$&#123logo&#125

<#if emailTemplateForm.emailTemplate.name == 'realtor_thank_you'>
$&#123referringAgent.name&#125
$&#123referringAgent.name.first&#125
$&#123referringAgent.name.last&#125
$&#123referringAgent.company&#125
</#if>

</textarea>
		</td>
	</tr>
	<TR>
		<td>
			<input type="Submit" name="submitButton" value="Preview"/>
			<input type="Submit" name="submitButton" value="Save"/>
			<a href="settings.html" class="formLink">-CANCEL-</a>
		</td>
	</TR>		
	</table>
	</form>
	
</div>	
</body>
</html>
